
import java.util.Random;
import java.util.Scanner;
//猜数字游戏
public class test {
    public static void main(String[] args) {
        Random random= new Random();
        Scanner scanner = new Scanner(System.in);
        int n=random.nextInt(100)+1;
        while(true){
            System.out.println("输入猜的数字");
            int key = scanner.nextInt();
            if(key > n){
                System.out.println("大了");
            }else if(key == n){
                System.out.println("猜对了"+key);
                break;
            }else{
                System.out.println("小了");
            }
        }


    }

}
